package com.iqiyi.pps.epg.core.model.sginal;

import com.iqiyi.pps.epg.api.model.web.sginal.TSginalLog;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by zhang on 2017/8/14.
 */
@Entity
@Table(name = "sginal_log")
@Cache(usage = CacheConcurrencyStrategy.NONE)
public class SginalLog {
    private Long id;
    private Integer fatherId;
    private String action;
    private String descr;
    private String user;
    private Timestamp addTime;

    public TSginalLog convertThriftModel() {
        TSginalLog tSginalLog = new TSginalLog();
        tSginalLog.setId(this.id);
        tSginalLog.setFatherId(this.fatherId);
        tSginalLog.setAction(this.action);
        tSginalLog.setDescr(this.descr);
        tSginalLog.setUser(this.user);
        tSginalLog.setAddTime(this.addTime.toString());
        return tSginalLog;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="father_id")
    public Integer getFatherId() {
        return fatherId;
    }

    public void setFatherId(Integer fatherId) {
        this.fatherId = fatherId;
    }

    @Column(name="action")
    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Column(name="descr")
    public String getDescr() {
        return descr;
    }

    public void setDescr(String descr) {
        this.descr = descr;
    }

    @Column(name="user")
    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

    @Column(name="add_time")
    public Timestamp getAddTime() {
        return addTime;
    }

    public void setAddTime(Timestamp addTime) {
        this.addTime = addTime;
    }
}
